unit td_ProductType;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, DB,
  Dialogs, BaseTreeForm, ImgList, Menus, StdCtrls, Buttons, ComCtrls, ExtCtrls,
  cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters, cxDropDownEdit,
  dxSkinsCore, cxEdit, cxTextEdit, cxMaskEdit, cxDBLookupComboBox,
  dxSkinsDefaultPainters, cxContainer,
  dxSkinsForm, cxCheckBox, cxLabel, System.ImageList, cxButtons;

type
  TFrmtd_ProductType = class(TfrmBaseTreeForm)
    edtPause: TcxCheckBox;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  protected
    procedure SetControlEnable(p_dsState: TDataSetState); override;
    procedure AfterScroll(DataSet: TDataSet); override;
    procedure AddFieldsEdit; override;
  public
    { Public declarations }
  end;

var
  Frmtd_ProductType: TFrmtd_ProductType;

implementation

uses MisString;

{$R *.dfm}

procedure TFrmtd_ProductType.AddFieldsEdit;
begin
  inherited;
  ADODataSet.fieldbyname('pause').AsBoolean := edtPause.Checked;
end;

procedure TFrmtd_ProductType.AfterScroll(DataSet: TDataSet);
begin
  inherited;
  edtPause.Checked := DataSet.FieldByName('pause').AsBoolean;
end;

procedure TFrmtd_ProductType.FormCreate(Sender: TObject);
begin
  TableName := 'td_ProductType';
  inherited;
//  TcxDBLookupOnKeyUp(dynedtProductKind.Tag).DropDownFilter := 'kid>=3';
end;

procedure TFrmtd_ProductType.SetControlEnable(p_dsState: TDataSetState);
begin
  inherited;
//  dynedtProductKind.Enabled := (p_dsState in [dsInsert, dsEdit]);
  edtPause.Enabled := (p_dsState in [dsInsert, dsEdit]);
end;

end.

